<%@ taglib uri="/WEB-INF/lib/mentawai.jar" prefix="mtw" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<mtw:inputMaskConfig></mtw:inputMaskConfig>
<mtw:inputMoneyConfig />

<html>
    <head>
        <!--<meta content="text/html; charset=ISO-8859-1"
              http-equiv="content-type">-->
        <title></title>
    </head>
    <body>
        <form name="frmCadProduto" method="post" >
            <!--<mtw:out value="caminhoImagem"/>-->
            
            <table border="1">
                <tr><td colspan="2" align="center" class="titulo"><img src="<mtw:contextPath />/img/<mtw:out value="caminhoImagem"/>" width="50" />Cadastro de Produtos</td>
                <tr>
                    <td>Codigo:</td>
                    <td>
                        <mtw:inputMask name="txtCodigo" maskCustom="99" maxlength="4" size="4"></mtw:inputMask>
                        <input  name="btnPesquisar" type="button" id="btnPesquisar" value="Pesquisar" onclick="submitFormConsultar();" />
                        <font color="red">
                            <mtw:outError field="txtCodigo"><mtw:out />
                            </mtw:outError>
                        </font>
                    </td>
                </tr>
                <tr>
                    <td>Nome:</td>
                    <td><mtw:inputText name="txtNome" maxlength="100" size="30"  />
                        <font color="red">
                            <mtw:outError field="txtNome"><mtw:out /></mtw:outError>
                        </font>
                <tr>
                    <td>Descrição:</td>
                    <td><mtw:inputText  name="txtDescricao" maxlength="100" size="30"  />
                        <font color="red">
                            <mtw:outError field="txtDescricao"><mtw:out /></mtw:outError>
                        </font>
                <tr>
                    <td>Preço:</td><td>  <mtw:inputMoney name="txtPreco"  decimals="2" dec_point="."  thousands_sep="," textAlign="right" size="10"></mtw:inputMoney>
                        <font color="red">
                            <mtw:outError field="txtPreco"><mtw:out /></mtw:outError>
                        </font>
                <tr>
                    <td>Preço Promocional:</td><td>  <mtw:inputMoney name="txtPrecoPromocional" decimals="2" dec_point="."  thousands_sep="," textAlign="right"  size="10"/>
                        <font color="red">
                            <mtw:outError field="txtPrecoPromocional"><mtw:out /></mtw:outError>
                        </font>
                <tr>
                    <td>Foto:</td><td> <input name="txtFoto" type="file"  />
                        <mtw:input name="txtUrl" type="hidden"  />
                        <font color="red">
                            <mtw:outError field="txtUrl"><mtw:out /></mtw:outError>
                            <mtw:outError field="txtFoto"><mtw:out /></mtw:outError>
                        </font>
                <tr>
                    <td>Estoque:</td><td>  <mtw:inputMask name="txtEstoque" maskDefined="9" size="4" value="0" />
                        <font color="red">
                            <mtw:outError field="txtEstoque"><mtw:out /></mtw:outError>
                        </font>
                <tr>
                    <td style="vertical-align: top;">Status<br> </td>
                    <td style="vertical-align: top;">
                        <mtw:input type="checkbox"  name="ckPromocao" />
                        <font color="red"><mtw:outError field="ckPromocao"><mtw:out /></mtw:outError></font></td>
                </tr>

                <tr><td><input  name="btnOK" type="button" id="btnOK" value="OK" onclick="submitFormCadastrar();"/>
                        <input  name="btnLimpar" type="reset" id="btnLimpar" value="Limpar" /></td></tr>



            </table>
            <mtw:out value="listaProdutos"/>
        </form>
    </body>


    <script language="JavaScript">


        function submitFormCadastrar(){
            document.frmCadProduto.action = "MentaProduto.salvarProduto.mtw";
            document.frmCadProduto.enctype="multipart/form-data"
            document.frmCadProduto.submit();
        }

        function submitFormUpload(){
            document.frmCadProduto.action = "MentaProduto.upload.mtw";
            document.frmCadProduto.submit();
        }

        function submitFormConsultar(){
            document.frmCadProduto.action = "MentaProduto.consultarProduto.mtw";
            document.frmCadProduto.submit();
        }
        
    </script>
</html>
